"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

import os
from django.test import TestCase
from django.utils.unittest import skipUnless

from institutes.models import DailyCounsel, DailyMeeting

class InstituteTests(TestCase):
    
    @skipUnless(os.environ['DJANGO_SETTINGS_MODULE'].endswith('test'), "Only test this on a test server.")
    def test_generate_daily_tougu_report(self):
        from institutes.tasks import generate_daily_tougu_report
        from news.models import NewsEdition
        date_str = '2014-01-13'
        generate_daily_tougu_report(NewsEdition.MORNING, date_str)
        self.assertEqual(DailyCounsel.objects.all().count(), 3)
    
    def test_import_daily_meeting(self):
        from institutes.tasks import import_daily_meeting
        date_str = '2014-01-13'
        import_daily_meeting(date_str)
        self.assertEqual(DailyMeeting.objects.all().count(), 0)
